#!/bin/bash
if [ "$#" -ne "1" ] ; then
exit 0
fi
fileName=$(basename "$1")
if [ -d "$1" ] ; then
fileName="$fileName.zip"
cd "$1"
zip -r "$HOME/Dropbox/Public/$fileName" .
else
cp "$1" "$HOME/Dropbox/Public/"
fi
echo "$(dropbox puburl "$HOME/Dropbox/Public/$fileName")" | tee /tmp/clipboard | xclip -selection clipboard
exit 0
